import React, { Component } from 'react';
import { StyleSheet, View } from 'react-native';
import { Button, Text } from 'native-base';
import { Actions } from 'react-native-router-flux';


export default class DetailsScene extends Component {
  constructor(props) {
    super(props);
    this.state = {
      count: 0
    };
  }

  increase = () => {
    this.setState({
      count: this.state.count + 1
    });
  };

  componentWillMount() {
    // 设置导航的参数
    this.props.navigation.setParams({
      _increase: this.increase
    });
  }
  

  render() {
    console.log(this.props)
    return (
      <View>
        <Text>DetailsScene</Text>
        <Text>
          Count:
          {this.state.count}
        </Text>
        <Text>
          id:
          {this.props.id}
        </Text>
        <Text>
          OtherParams:
          {this.props.otherParams}
        </Text>
        <Button
          onPress={() => {
            Actions.pop();
          }}
        >
          <Text>返回首页</Text>
        </Button>
      </View>
    );
  }
}
